package cn.thornbird.orgsync.entity;

import cn.thornbird.orgsync.entity.status.VerificationCodeUsage;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Entity
@Table(name = "verification_codes")
@Where(clause = "deleted_at is null")
public class VerificationCode extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 6113137923908164439L;

    @Column(name = "mobile")
    private String mobile;

    @Column(name = "code")
    private String code;

    @Column(name = "usage")
    private VerificationCodeUsage usage;

    @Column(name = "success")
    private Boolean success;

    @Column(name = "used")
    private Boolean used;

    @Column(name = "response_body")
    private String responseBody;

    @Column(name = "error_message")
    private String errorMessage;

}
